//
//  WJMainVideoCell.m
//  WJBSApp
//
//  Created by rumble on 2018/11/23.
//  Copyright © 2018年 王景伟. All rights reserved.
//

#import "WJMainVideoCell.h"

@interface WJMainVideoCell ()
@property (nonatomic,strong) UIImageView *playImage;
@property (nonatomic,strong) UILabel *countLable;
@property (nonatomic,strong) UILabel *durationLable;
@end

@implementation WJMainVideoCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    [self createVideoCell];
    return self;
}

- (void)createVideoCell {
    self.playImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 80, 80)];
    self.playImage.backgroundColor = BSClearColor;
    self.playImage.image = BSIMG(@"video-play");
    [self.detailImage addSubview:self.playImage];
    
    self.countLable = [[UILabel alloc]init];
    self.countLable.backgroundColor = [UIColor colorWithRed:29/255.0 green:29/255.0 blue:29/255.0 alpha:0.8];
    self.countLable.font = BSFont(kBSCountFont);
    self.countLable.textColor = BSWhiteColor;
    [self.detailImage addSubview:self.countLable];
    
    self.durationLable = [[UILabel alloc]init];
    self.durationLable.backgroundColor = [UIColor colorWithRed:29/255.0 green:29/255.0 blue:29/255.0 alpha:0.8];
    self.durationLable.font = BSFont(kBSCountFont);
    self.durationLable.textColor = BSWhiteColor;
    [self.detailImage addSubview:self.durationLable];
}

- (void)setLayout:(WJMianLayout *)layout {
    [super setLayout:layout];
    
    self.playImage.center = CGPointMake(kBSContentW / 2.0f, layout.imageRect.size.height / 2.0f);
    
    self.countLable.text = layout.countText;
    self.durationLable.text = layout.durationText;
    
    self.countLable.frame = layout.countRect;
    self.durationLable.frame = layout.durationRect;
}
@end
